import path from 'path';
import { Config } from '@stencil/core';
import { sass } from '@stencil/sass';

const globalStyle = path.resolve('./src', 'styles/index.scss');

export const config: Config = {
  namespace: 'components',
  enableCache: false,
  devServer: {
    openBrowser: false,
    reloadStrategy: 'hmr'
  },
  plugins: [
    sass({
      injectGlobalPaths: [
        'src/styles/index.scss'
      ]
    }),
  ],
  // globalStyle,
  outputTargets: [
    {
      type: 'dist',
      esmLoaderPath: '../loader',
    },
    {
      type: 'dist-custom-elements',
    },
    {
      type: 'docs-readme',
    },
    {
      type: 'www',
      serviceWorker: null, // disable service workers
    },
  ],
};
